using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Zosnn.Models.Mapping
{
    public class WebUserMap : EntityTypeConfiguration<WebUser>
    {
        public WebUserMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.LoginName)
                .HasMaxLength(200);

            this.Property(t => t.Password)
                .HasMaxLength(200);

            this.Property(t => t.DisplayName)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("WebUser");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.LoginName).HasColumnName("LoginName");
            this.Property(t => t.Password).HasColumnName("Password");
            this.Property(t => t.DisplayName).HasColumnName("DisplayName");
            this.Property(t => t.Created).HasColumnName("Created");
            this.Property(t => t.Activation).HasColumnName("Activation");
            this.Property(t => t.SuperAdmin).HasColumnName("SuperAdmin");
        }
    }
}
